package com.jason.account.service;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface IAccountService {

    @TwoPhaseBusinessAction(name = "account", commitMethod = "commit", rollbackMethod = "rollback",useTCCFence = true)
    boolean prepare(BusinessActionContext businessActionContext,@BusinessActionContextParameter(paramName = "accountId") Integer accountId,
                    @BusinessActionContextParameter(paramName = "amount") Integer amount);

    boolean commit(BusinessActionContext businessActionContext);

    boolean rollback(BusinessActionContext businessActionContext);
}
